var die = function(attributes, faceAttributes, faceValues) {
	var faces = new Array();
	
	for(var i = 0; i < faceValues.length; i++) {				
		faces.push(objectFromKeysValues(attributes, faceValues[i]));
	}
		
	return {
		"getAttributes": function() {
			return attributes;
			},
		"getFaceAttributes": function() {
			return faceAttributes;
			},
		"getFaceAt": function(index) {
			return faces[index];
		},
		"roll": function() {
				return Math.floor(Math.random() * (faces.length));
			}
	}
};